
import 'package:mysql1/src/results/row.dart';

class TpcInfo{
  int id = -1;
  int tpcAddr = -1;
  int tpcAddrBit = -1;
  String tpcSName = "";
  String tpcLName = "";
  int tpcColor = 0;
  int tpcPush = 0;

  TpcInfo(this.id, this.tpcAddr, this.tpcAddrBit, this.tpcSName, this.tpcLName,
      this.tpcColor, this.tpcPush);

  static TpcInfo builder(ResultRow row) {
    int id = row[0];
    int tpcAddr = row[1];
    int tpcAddrBit = row[2];
    String tpcSName = null==row[3] ? "":row[3].toString();
    String tpcLName = null==row[4] ? "":row[4].toString();
    int tpcColor = row[5];
    int tpcPush = row[6];
    return TpcInfo(id, tpcAddr, tpcAddrBit, tpcSName, tpcLName, tpcColor, tpcPush);
  }
}